const http = require("http");
const path = require("path");
const fs = require("fs");
const { URL } = require("url");
const url = require("url");
const querystring = require("querystring");
http.createServer((req , res) => {
    let urlObj = new URL(req.url , "http://192.168.42.166:3000");
    console.log(urlObj);
    if(req.url === '/') {
        let content = fs.readFileSync(path.join(__dirname , "index.html"));
        res.end(content);
    } else {
        console.log(url.parse(req.url).query)
        console.log(querystring.parse(url.parse(req.url).query));
    }
    res.end("123456");
}).listen(3000)